As a method of attaching a thermistor that measures the temperature of a stator winding of an electric rotating machine is known a method which is described in e.g. patent document 1. Patent document 1 discloses an electric rotating machine that has the following features. This electric rotating machine includes an annular stator core; a plurality of slot portions formed in the stator core; a plurality of rectangular wires wound around the plurality of slot portions according to a predetermined winding method to form a coil portion, each of the rectangular wires having a rectangle in cross-section; a coil end portion formed as a portion from which the plurality of rectangular wires project to an axial end face of the stator core, the coil end portion being such that the plurality of rectangular wires are arranged parallel to each other along the circumferential direction of the stator core with one flat surface of the rectangular cross-section of the rectangular wire being parallel to an end face of the stator core; and a temperature sensor disposed at the coil end portion. The coil end portion has a parallel separate-wall space that is formed by further more projecting, of the plurality of rectangular wires arranged parallel to each other along the circumferential direction of the stator core, two rectangular wires arranged with an interval spaced apart from each other in the radial direction of the stator core than the other rectangular wires arranged in the interval. The temperature sensor is received and disposed in the separate-wall space of the coil end.